package com.flyco.modules.returns.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.flyco.modules.returns.entity.OmsOrderReturnItemBatch;
import com.flyco.modules.returns.mapper.OmsOrderReturnItemBatchMapper;
import com.flyco.modules.returns.service.IOmsOrderReturnItemBatchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.List;

/**
 * @Description: 退单明细批次表
 * @Author: flyco
 * @Date:   2023-08-30
 * @Version: V1.0
 */
@Service
public class OmsOrderReturnItemBatchServiceImpl extends ServiceImpl<OmsOrderReturnItemBatchMapper, OmsOrderReturnItemBatch> implements IOmsOrderReturnItemBatchService {

    @Autowired
    private OmsOrderReturnItemBatchMapper returnItemBatchMapper;

    @Override
    public List<OmsOrderReturnItemBatch> getByApplyId(Long applyId){

        LambdaQueryWrapper<OmsOrderReturnItemBatch> wrapper=new LambdaQueryWrapper<>();
        wrapper.eq(OmsOrderReturnItemBatch::getReturnApplyId,applyId);

        return returnItemBatchMapper.selectList(wrapper);
    }

    @Override
    public Integer batchNoIsCorrect(String batchNo,String skuCode){

        return returnItemBatchMapper.batchNoIsCorrect(batchNo,skuCode);
    }
}
